package com.city.service.report.impl;

import com.city.domain.report.CtPart;
import com.city.repository.report.CtPartRepository;
import com.city.service.report.CtPartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: 李顺时
 * @Description:
 * @Date: Create in 15:12 2018/9/7
 * @Modified By:
 * */

@Service
public class CtPartServiceImpl  implements CtPartService {
    @Autowired
    private CtPartRepository ctPartRepository;

    @Override
    public CtPart findPartById(Integer id) {
        return ctPartRepository.findOne(id);
    }

    @Override
    public List<CtPart> findAll() {
        return ctPartRepository.findAll();
    }

    @Override
    public CtPart findPartByCode(String partCode) {
        return ctPartRepository.findPartByCode(partCode);
    }

    @Override
    public CtPart savePart(CtPart ctPart) {
        return ctPartRepository.save(ctPart);
    }
}
